package com.dx.architectureddd.app.event.handler;

import com.dx.architectureddd.client.dto.event.JoinGameEvent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * 加入游戏监听器
 *
 * @author xin.deng
 * @date 2023/09/24
 */
@Slf4j
@Component
public class JoinGameEventListener {
    @EventListener
    @Async
    public void listenEvent(JoinGameEvent event) {
        log.info("have listened the JoinGameEvent");
        String level = (String) event.getSource();
        log.info("level：{} 玩家进入游戏", level);
    }
}
